home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / bin / ws < prev    next >
Text File  |  1995-07-26  |  1KB  |  41 lines

  1. #!/usr/local/bin/perl
  2.  
  3. # WIDE AREA INFORMATION SERVER SOFTWARE:
  4. #   No guarantees or restrictions.  See the readme file for the full standard
  5. #   disclaimer.
  6. #
  7. # A quick shell interface to WAIS:
  8. #   
  9. #      ws <dbname> word ....
  10. #  eg. ws wais-docs  what is wais
  11. #
  12. #Created by Randal L. Schwartz, 
  13. # Stonehenge Consulting Services, Portland, Oregon
  14. # distributed without restriction.
  15.  
  16. $src = shift;
  17. open(SRC,"$ENV{'HOME'}/wais-sources/$src.src") ||
  18.  open(SRC,"$ENV{'HOME'}/wais-sources/$src") ||
  19.  open(SRC,"$ENV{'WAISCOMMONSOURCEDIR'}/$src.src") ||
  20.  open(SRC,"$ENV{'WAISCOMMONSOURCEDIR'}/$src") ||
  21.  die "Cannot open $1.src: $!";
  22. # print <SRC>;
  23. while(<SRC>) {
  24.     /:ip-name "(.*)"/ && ($ipname = $1);
  25.     /:database-name "(.*)"/ && ($databasename = $1);
  26.     /:tcp-port "(.*)"/ && ($tcpport = $1);
  27.     /:tcp-port (\d+)/ && ($tcpport = $1);
  28. }
  29. close(SRC);
  30. print "waissearch ", 
  31.     "-h ", $ipname,
  32.     " -d ", $databasename,
  33.     " -p ", $tcpport, " ",
  34.     @ARGV, "\n";
  35.  
  36. exec "waissearch",
  37.     "-h", $ipname,
  38.     "-d", $databasename,
  39.     "-p", $tcpport,
  40.     @ARGV;
  41.